package cn.zhc.com.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

/**
 * Created by zhouhongchun on 2017/8/14.
 * 与时间相关的工具类
 */

public class UtilsTime {

    public static String Y_M_D_H_M_S = "yyyy-MM-dd    HH:mm:ss";
    public static String Y_M_D_H_M = "yyyy-MM-dd    HH:mm";
    public static String Y_M_D= "yyyy-MM-dd";
    public static String H_M_S = "HH:mm:ss";
    public static String H_M = "HH:mm";
    private static String getFormatTime(String format ,long timeInMillis) {
        Date date = new Date(timeInMillis);
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
        String currentTime = sdf.format(date);
        return currentTime;
    }

    /**
     * get current time in milliseconds
     */
    public static long getCurrentTimeInLong() {
        return System.currentTimeMillis();
    }

    /**
     * 选择时间
     */
    public static void selectTime(){
        Calendar selectedDate = Calendar.getInstance();
        Calendar startDate = Calendar.getInstance();
        //startDate.set(2013,1,1);
        Calendar endDate = Calendar.getInstance();
        //endDate.set(2020,1,1);

        //正确设置方式 原因：注意事项有说明
        startDate.set(2013,0,1);
        endDate.set(2020,11,31);
    }
}
